//
//  LogCatLocalModel.m
//  LogCat
//
//  Created by gonghong on 2022/11/25.
//

#import "LogCatLocalModel.h"

@implementation LogCatLocalModel

- (instancetype)init {
    self = [super init];
    self.bundleId = @"";
    self.appId = @"";
    self.appKey = @"";
    self.version = @"";
    self.scheme = @"";
    self.validYear = @"3023";
    self.validMonth = @"01";
    self.validDay = @"01";

    // 本地的
    self.localUrl = @"";
    self.webUrl = @"";
    self.ossSuffix = @"config";
    
    self.autoPushWeb = NO;
    self.isChangeRoot = NO;
    self.enableLog = NO;
    self.autoCarsh = NO;
    self.isSwiftUI = NO;
    self.needRemote = YES;
    self.getDataFromPlist = NO;
    self.statusBarStyle = 1;
    self.belowStatusBar = NO;
    self.belowNavigationBar = YES;
    self.showNavigationBar = YES;
    
    return  self;
}

// 从info.plist解析的数据

- (void)setLogCat_AppId:(NSString *)LogCat_AppId {
    _LogCat_AppId = LogCat_AppId;
    self.appId = LogCat_AppId;
}

- (void)setLogCat_AppKey:(NSString *)LogCat_AppKey {
    _LogCat_AppKey = LogCat_AppKey;
    _appKey = LogCat_AppKey;
}

- (void)setLogCat_Scheme:(NSString *)LogCat_Scheme {
    _LogCat_Scheme = LogCat_Scheme;
    _scheme = LogCat_Scheme;
}

- (void)setLogCat_ValidYear:(NSString *)LogCat_ValidYear {
    _LogCat_ValidYear = LogCat_ValidYear;
    _validYear = LogCat_ValidYear;
}

- (void)setLogCat_ValidMonth:(NSString *)LogCat_ValidMonth {
    _LogCat_ValidMonth = LogCat_ValidMonth;
    _validMonth = LogCat_ValidMonth;
}

- (void)setLogCat_ValidDay:(NSString *)LogCat_ValidDay {
    _LogCat_ValidDay = LogCat_ValidDay;
    _validDay = LogCat_ValidDay;
}

- (void)setLogCat_LocalUrl:(NSString *)LogCat_LocalUrl {
    _LogCat_LocalUrl = LogCat_LocalUrl;
    _localUrl = LogCat_LocalUrl;
}

- (void)setLogCat_OssSuffix:(NSString *)LogCat_OssSuffix {
    _LogCat_OssSuffix = LogCat_OssSuffix;
    _ossSuffix = LogCat_OssSuffix;
}


/// 初始化配置
/// - Parameter configDict: 字典
-(instancetype)initWithDictionary:(NSDictionary *)configDict {
    self = [super init];
    if (self) {
        self.bundleId = [configDict valueForKey:@"bundleId"];
        self.appId = [configDict valueForKey:@"appId"];
        self.appKey = [configDict valueForKey:@"appKey"];
        self.version = [configDict valueForKey:@"version"];
        self.scheme = [configDict valueForKey:@"scheme"];
        self.validYear = [configDict valueForKey:@"validYear"];
        self.validMonth = [configDict valueForKey:@"validMonth"];
        self.validDay = [configDict valueForKey:@"validDay"];

        self.localUrl = [configDict valueForKey:@"localUrl"];

        self.autoPushWeb =  [[configDict valueForKey:@"autoPushWeb"] boolValue];
        self.isChangeRoot =  [[configDict valueForKey:@"isChangeRoot"] boolValue];
        self.enableLog =  [[configDict valueForKey:@"enableLog"] boolValue];
        self.autoCarsh =  [[configDict valueForKey:@"autoCarsh"] boolValue];
        self.isSwiftUI =  [[configDict valueForKey:@"isSwiftUI"] boolValue];
        self.needRemote =  [[configDict valueForKey:@"needRemote"] boolValue];
        self.statusBarStyle =  [[configDict valueForKey:@"statusBarStyle"] integerValue];
        self.belowStatusBar =  [[configDict valueForKey:@"belowStatusBar"] boolValue];
        self.belowNavigationBar =  [[configDict valueForKey:@"belowNavigationBar"] boolValue];
        self.showNavigationBar =  [[configDict valueForKey:@"showNavigationBar"] boolValue];
    }
    return self;
}


@end
